package com.papercutting.platform.dto.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 轮播图请求
 */
@Data
public class BannerRequest implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    private Long id;
    
    @NotBlank(message = "标题不能为空")
    @Size(max = 200, message = "标题长度不能超过200个字符")
    private String title;
    
    @Size(max = 500, message = "描述长度不能超过500个字符")
    private String description;
    
    @NotBlank(message = "图片地址不能为空")
    @Size(max = 500, message = "图片地址长度不能超过500个字符")
    private String imageUrl;
    
    @NotNull(message = "链接类型不能为空")
    @Min(value = 1, message = "链接类型值不正确")
    @Max(value = 3, message = "链接类型值不正确")
    private Integer linkType = 1;
    
    @Size(max = 500, message = "链接地址长度不能超过500个字符")
    private String linkUrl;
    
    @Size(max = 20, message = "目标类型长度不能超过20个字符")
    private String targetType;
    
    private Long targetId;
    
    @Min(value = 0, message = "排序号不能为负数")
    private Integer sortOrder = 0;
    
    @NotNull(message = "状态不能为空")
    @Min(value = 0, message = "状态值不正确")
    @Max(value = 1, message = "状态值不正确")
    private Integer status = 1;
    
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;
    
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;
}